import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:求斐波那契数列的第n项。(迭代实现)
 * User: xwl
 * Date: 2023-04-02
 * Time: 17:48
 */
public class Test6 {
    public class Test {
        public static void main(String[] args) {
            // 1 1 2 3 5 8 13 21
            //循环输入
            Scanner scan = new Scanner(System.in);
            while(scan.hasNextInt()) {
                int n = scan.nextInt();
                int ret = getNum(n);
                int ret2 = getNum(n);
                System.out.println(ret);
                System.out.println(ret2);
            }
        }
        //递归实现
        public static int getNum(int n) {
            if(n==1 || n==2) {
                return 1;
            }else {
                return getNum(n-1)+getNum(n-2);
            }
        }
        //迭代实现
        public static int getNum2(int n ) {
            if(n==1 || n==2) {
                return 1;
            }
            int f1 = 1;
            int f2 = 1;
            int f3 = 0;
            //
            for (int i = 3; i < n; i++) {
                f3 = f1 + f2;
                f1 = f2;
                f2 = f3;
            }
            return f3;
            
        }
    }
}
